<template>
	<view class="w-message">
		<view class="header">
			<!-- 头像 -->
			<image class="avt" :src="img" mode="scaleToFill" style="width: 50rpx;height: 50rpx;"></image>
			<!-- 姓名 -->
			<text style="margin-left: 30rpx;">{{nickName}}</text>
		</view>
		<!-- 留言 -->
		<view class="txt">
			{{message}}
		</view>
		<!-- 时间 -->
		<view class="time">
			{{time}}
		</view>
		<button type="default" @click="test"></button>
	</view>
</template>

<script>
	export default {
		name: "w-message",
		props: ['img', 'nickName', 'message', '_id', 'time'], //获取商品_id
		data() {

			return {
				// img: '../static/icon/dz.png',
				// nickName: '吃狗狗',
				// message: "搞耍说"
			};
		},
		methods: {
			test() {
				console.log(this.img)
			}
		}
	}
</script>

<style scoped>
	.w-message {
		margin-top: 30rpx;
		border-bottom: 2rpx solid #e5e5e5;
		padding: 10rpx 30rpx 20rpx;
	}

	.header {
		display: flex;
		align-items: center;
		font-size: 24rpx;
		
	}

	.avt {
		border-radius: 50%;
	}

	.txt {
		margin: 15rpx 0 15rpx 50rpx;
		font-size: 24rpx;
	}

	.time {
		font-size: 24rpx;
		color: #aaa;
	}
</style>
